GtkRadioButtons: Mark group arguments as "allow-none"
authorMartin Pitt <martin.pitt@ubuntu.com>
Fri, 19 Nov 2010 09:19:32 +0000 (10:19 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Fri, 19 Nov 2010 15:29:43 +0000 (16:29 +0100)
In the current introspection data, the various gtk_radio_button_new_*
constructors take an existing group or widget. These all allow passing a NULL
widget or group list, so that it becomes easy to build a radio button list in a
loop (pass in None the first time, and the previously created button in all
other iterations).

Add the missing "allow-none" tag to the introspection data, so that this will
also eventually work for GIR users. NB that it does not actually work for some
constructors yet (like new_with_label_from_widget()) due to
https://bugzilla.gnome.org/show_bug.cgi?id=561264.

https://bugzilla.gnome.org/show_bug.cgi?id=635253

gtk/gtkradiobutton.c

index e22adf68a7ee19f875fa736edfb35b036831ede8..ff607cea56d1c9c4aadd69f8d67423d91177e496 100644 (file)
@@ -403,7 +403,8 @@ gtk_radio_button_join_group (GtkRadioButton *radio_button,
 
 /**
  * gtk_radio_button_new:
- * @group: an existing radio button group, or %NULL if you are creating a new group.
+ * @group: (allow-none): an existing radio button group, or %NULL if you are
+ *  creating a new group.
  *
  * Creates a new #GtkRadioButton. To be of any practical value, a widget should
  * then be packed into the radio button.
@@ -425,8 +426,8 @@ gtk_radio_button_new (GSList *group)
 
 /**
  * gtk_radio_button_new_with_label:
- * @group: an existing radio button group, or %NULL if you are creating a new
- *  group.
+ * @group: (allow-none): an existing radio button group, or %NULL if you are
+ *  creating a new group.
  * @label: the text label to display next to the radio button.
  *
  * Creates a new #GtkRadioButton with a text label.
@@ -450,7 +451,7 @@ gtk_radio_button_new_with_label (GSList      *group,
 
 /**
  * gtk_radio_button_new_with_mnemonic:
- * @group: the radio button group
+ * @group: (allow-none): the radio button group
  * @label: the text of the button, with an underscore in front of the
  *         mnemonic character
  *
@@ -480,7 +481,7 @@ gtk_radio_button_new_with_mnemonic (GSList      *group,
 
 /**
  * gtk_radio_button_new_from_widget:
- * @radio_group_member: an existing #GtkRadioButton.
+ * @radio_group_member: (allow-none): an existing #GtkRadioButton.
  *
  * Creates a new #GtkRadioButton, adding it to the same group as
  * @radio_group_member. As with gtk_radio_button_new(), a widget
@@ -499,7 +500,7 @@ gtk_radio_button_new_from_widget (GtkRadioButton *radio_group_member)
 
 /**
  * gtk_radio_button_new_with_label_from_widget:
- * @radio_group_member: widget to get radio group from or %NULL
+ * @radio_group_member: (allow-none): widget to get radio group from or %NULL
  * @label: a text string to display next to the radio button.
  *
  * Creates a new #GtkRadioButton with a text label, adding it to